﻿//服务端控件ID获取
var ClientId = getClientId();

function changeSize(obj) {
    var status = obj.status;
    var souce = obj.src;
    if (status === "0") {
        obj.oldwidth = obj.width;
        obj.oldheight = obj.height;
    }

    var myImg = new Image(); //定义图像对象，获取宽高
    myImg.setAttribute("src", souce);
    var imgWidth = myImg.width;
    var imgHeight = myImg.height;

    if (status == 0) {
        obj.status = 1;
        $(obj).animate({
            "height": imgHeight, "width": imgWidth, "opacity": "1"
        }, "normal");
    } else {
        obj.status = 0;
        $(obj).animate({
            "height": obj.oldheight, "width": obj.oldwidth, "opacity": "1"
        }, "normal");
    }

}

function uploadFile(archInfoId) {
    if (archInfoId != '') {
        var result = window.showModalDialog("FileUploader.aspx?archInfoId=" + archInfoId, null, "dialogheight: 450px; dialogwidth: 620px; center:yes; resizable:yes; scroll:no; status:no;");
        if (result == "ok") {
            listSearch();
        }
    } else {
        alert('请先保存表单。');
    }
}

function listSearch() {
    $(ClientId.btnSearch)[0].click();
}

function deleteConfirm() {
    if (confirm('确定要删除该条记录？')) {
        return true;
    }
    return false;
}